<template>
  <!-- SpecialList 专题列表 -->
  <PageContainer>
    <view class="container">
      <Header title="更多" :isBoxShadow="false" />
      <view class="px-15">
        <Paglist
          v-model="dataList"
          :parame="parame"
          @register="register"
          :is-show-loadmore="dataList.length > 1"
        >
          <template>
            <Special :list="dataList" :loading="loading" />
          </template>
        </Paglist>
      </view>
    </view>
  </PageContainer>
</template>

<script lang="ts" setup>
  /**  SpecialList  专题列表 */
  import PageContainer from '@/components/PageContainer/index.vue';
  import { ref, reactive, provide } from 'vue';
  import Header from '@/components/Header/index.vue';
  import Special from '../../base/home/components/special.vue';
  import { getSpecialList } from '@/api/dynamicAllocation';
  import { type HomeTabResult } from '@/api/dynamicAllocation/types';
  import Paglist from '@/components/Paglist/index.vue';
  import { useConList } from '@/components/Paglist/useConList';

  provide('api', (obj: any) => {
    return getSpecialList(obj);
  });

  const dataList = ref<HomeTabResult[]>([]);
  const loading = ref(true);
  const parame = reactive({
    current: 1,
    size: 14,
  });
  const [useRegister] = useConList();

  function register(event: any) {
    useRegister(event);
    loading.value = false;
  }
</script>

<style lang="scss" scoped>
  .container {
    min-height: 100vh;
    background-color: #ffffff;
  }
</style>
